#include "../code/server.hpp"

int main()
{
    
    Socket client;
    client.CreateClient(8080, "127.0.0.1");
    // sleep(10);
    for(int i = 1; i <= 5; i++)
    {
        std::string push = "hello muduo" + std::to_string(i);
        client.Send(push.c_str(), push.size(), 0);
 
        char recv[1024] = { 0 };
        int ret = client.Recv(recv, 1023, 0);
        if(ret > 0)
        {
            recv[ret] = '\0';
            std::cout << recv << std::endl;
        }

        sleep(1);
    }

    
    sleep(10);

    return 0;
}